package com.test.learnopenglandroid.chapter5;

import android.view.View;
import android.widget.FrameLayout;
import android.widget.LinearLayout;

import com.test.learnopenglandroid.UIHelper;

public class Chapter5 {
    public static void init(LinearLayout chapterRoot, final LinearLayout buttonRoot, FrameLayout renderRoot){
        final LinearLayout btnRoot = buttonRoot;
        final FrameLayout frenderRoot = renderRoot;
        UIHelper.addTest(chapterRoot,"第五章 高级光照",new View.OnClickListener(){

            @Override
            public void onClick(View view) {
                btnRoot.removeAllViews();
                addAllTest(btnRoot,frenderRoot);
            }
        });
    }

    static private void addAllTest(LinearLayout buttonRoot,FrameLayout renderRoot){
        UIHelper.addTest(buttonRoot,"高级光照",
                new Test1AdvancedLighting(renderRoot.getContext(),renderRoot,
                        Test1AdvancedLighting.TestType.GLES20RendererAdvancedLighting));
        UIHelper.addTest(buttonRoot,"阴影映射 深度贴图",
                new Test3ShadowMapping(renderRoot.getContext(),renderRoot,
                        Test3ShadowMapping.TestType.GLES20ShadowMapDepthMapTest));
        UIHelper.addTest(buttonRoot,"阴影映射",
                new Test3ShadowMapping(renderRoot.getContext(),renderRoot,
                        Test3ShadowMapping.TestType.GLES20ShadowMapBasicTest));
        UIHelper.addTest(buttonRoot,"法线贴图",
                new Test4NormalMapping(renderRoot.getContext(),renderRoot,
                        Test4NormalMapping.TestType.GLES20NormalMappingTest));
    }
}
